window: Stop listening to headerbar title changes
authorAlexander Mikhaylenko <alexm@gnome.org>
Wed, 22 Apr 2020 17:56:52 +0000 (22:56 +0500)
committerAlexander Mikhaylenko <alexm@gnome.org>
Thu, 23 Apr 2020 14:26:10 +0000 (19:26 +0500)
Remove another dependency.

gtk/gtkwindow.c

index 5de13adca4d49510b1c7f3c1e320f7c5907a13d3..08fc088acc44707f433ed1e2a34782c2d4c50b21 100644 (file)
@@ -538,9 +538,6 @@ static void             gtk_window_native_interface_init  (GtkNativeInterface  *
 
 static void ensure_state_flag_backdrop (GtkWidget *widget);
 static void unset_titlebar (GtkWindow *window);
-static void on_titlebar_title_notify (GtkHeaderBar *titlebar,
-                                      GParamSpec   *pspec,
-                                      GtkWindow    *self);
 static GtkWindowRegion get_active_region_type (GtkWindow   *window,
                                                gint         x,
                                                gint         y);
@@ -3053,9 +3050,6 @@ unset_titlebar (GtkWindow *window)
 
   if (priv->title_box != NULL)
     {
-      g_signal_handlers_disconnect_by_func (priv->title_box,
-                                            on_titlebar_title_notify,
-                                            window);
       gtk_widget_unparent (priv->title_box);
       priv->title_box = NULL;
       priv->titlebar = NULL;
@@ -3103,17 +3097,6 @@ gtk_window_enable_csd (GtkWindow *window)
   priv->client_decorated = TRUE;
 }
 
-static void
-on_titlebar_title_notify (GtkHeaderBar *titlebar,
-                          GParamSpec   *pspec,
-                          GtkWindow    *self)
-{
-  const gchar *title;
-
-  title = gtk_header_bar_get_title (titlebar);
-  gtk_window_set_title_internal (self, title, FALSE);
-}
-
 /**
  * gtk_window_set_titlebar:
  * @window: a #GtkWindow
@@ -3172,12 +3155,6 @@ gtk_window_set_titlebar (GtkWindow *window,
                               NULL);
 
   gtk_widget_set_parent (priv->title_box, widget);
-  if (GTK_IS_HEADER_BAR (titlebar))
-    {
-      g_signal_connect (titlebar, "notify::title",
-                        G_CALLBACK (on_titlebar_title_notify), window);
-      on_titlebar_title_notify (GTK_HEADER_BAR (titlebar), NULL, window);
-    }
 
   gtk_widget_add_css_class (titlebar, GTK_STYLE_CLASS_TITLEBAR);